public class Student {
    private String name = "张三";
    private int age = 10;
    private static String className = "1班";
    {
        name = "张三";
        age = 10;
        System.out.println("执行实例化代码块");
    }
    static{
        className = "1班";
        System.out.println("执行静态代码块");
    }

    public Student(){
        System.out.println("调用构造方法");
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public static String getClassName() {
        return className;
    }

    public static void setClassName(String className) {
        Student.className = className;
    }

/*    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public static String getClassName() {
        return className;
    }

    public static void setClassName(String className) {
        Student.className = className;
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }


    public void doHomework(){
        System.out.println(this.name+"做作业");
    }

    public void eat(){
        System.out.println(this.name+"吃饭");
    }

    public static void test(){
        System.out.println("考试");
    }

    public static void main(String[] args) {
        //this.name = 10;
        Student student1 = new Student();
        student1.eat();
        test();
    }*/
}
/*    public static void main1(String[] args) {
        Student student1 = new Student();
        student1.className = "1班";
        student1.show();
        System.out.println("=============");

        Student student2 = null;
        student2.className = "2班";
        student2.show();;
        System.out.println(Student.className);
        System.out.println("=============");

        Student.className = "3班";
        System.out.println(Student.className);

    }*/
        /*public void show() {
        System.out.println("班级：");
    }*/